package com.systop.busafter.journalism.mapper;

import com.systop.commer.pojo.Journalism;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface JsmMapper {
    /*
     * 修改journalism
     * journalism journalism
     * return int
     * csh
     * */
    @Update("update journalism set journalism_title = #{journalism_title},journalism_content1 = #{journalism_content1},journalism_content2 = #{journalism_content2},journalism_content3 = #{journalism_content3},journalism_state = #{journalism_state},journalism_remarks = #{journalism_remarks},journalism_s = #{journalism_s} where journalism_id = #{journalism_id}")
    int updatajournalism(Journalism journalism);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 添加journalism
     * journalism journalism
     * return int
     * csh
     * */
    @Insert("insert into journalism(journalism_title,journalism_content1,journalism_content2,journalism_content3,journalism_state,journalism_remarks,journalism_s) values (#{journalism_title},#{journalism_content1},#{journalism_content2},#{journalism_content3},#{journalism_state},#{journalism_remarks},#{journalism_s})")
    int insertjournalism(Journalism journalism);


    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from journalism")
    List<Journalism> journalismListall();

    /*
     * 用id查看journalism
     * journalism_id  int
     * list
     * csh
     * */
    @Select("select * from journalism where journalism_id = #{journalism_id}")
    List<Journalism> journalismIdlist(int journalism_id);

    /*
     * 删除journalism
     * journalism_id  int
     * return int
     * csh
     * */
    @Delete("delete from journalism where journalism_id=#{journalism_id}")
    int deletejournalism(int journalism_id);

    /*
     * 用状态查journalism
     * journalism_id  int
     * list
     * csh
     * */
    @Select("select * from journalism where journalism_state = #{journalism_state}")
    List<Journalism> journalismstatelist(int journalism_state);

    /*
     * 用状态查journalism
     * journalism_state  int
     * */
    @Select("select * from journalism where journalism_state = #{journalism_state}")
    List<Journalism> journalismstate(int journalism_state);

    /*
     * 通过id修改状态
     * journalism journalism
     * return int
     * csh
     * */
    @Update("update journalism set journalism_state = #{journalism_state} where journalism_id = #{journalism_id}")
    int updatajournastate(Journalism journalism);
}
